<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\FileInput;

/* @var $this yii\web\View */
/* @var $model common\models\Qualification */
$this->title = '图片列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pic-list">
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title ">图片相册</h3>
        </div>
        <div class="panel-body">
            <div class="row">
                <?php
                $items = [];
                if(empty($picList) == false){
                    foreach($picList as $gallery){
                        $items[] = [
                            'content' => '<img src="'.Yii::$app->params['imagesDomain'].$gallery->path.'" alt="...">',
                            'caption' => '<h4>This is title</h4><p>图片说明</p>',
//                            'options' => ['style' => 'height:400px;'],       //配置对应的样式
                        ];
                        ?>
                        <div class="col-xs-6 col-md-3" id="divUpdate<?=$gallery->id?>">
                            <div class="thumbnail">
                                <p class="text-center" style="margin: 4px 0px;">
                                    <a class="control-label btn btn-danger btn-xs" id="deleteRow<?=$gallery->id?>" onclick="deleteThumbnail('<?=$gallery->id?>')" href="javascript:;">
                                        <span class="glyphicon glyphicon-minus"></span>
                                    </a>
                                    <a class="control-label btn btn-success btn-xs" id="chosen_<?=$gallery->id?>"  href="javascript:;" title="图片名称">图片名称</a>
                                </p>
                                <img src="<?=Yii::$app->params['imagesDomain'].$gallery->path?>" alt="...">
                                <div class="caption">
                                </div>
                            </div>
                        </div>

                    <?php   }
                } ?>
            </div>

            <?php
//            echo \yii\bootstrap\Carousel::widget(['items' => $items]);
//            echo \yii\bootstrap\Carousel::widget([
//                'items' => [
////            // 只有图片的格式
////            '<img src="http://c.hiphotos.baidu.com/image/pic/item/77c6a7efce1b9d16efbcc03afedeb48f8c546475.jpg"/>',
////
////            // 与上面的效果一致
////            ['content' => '<img src="http://www.yii-china.com/statics/images/b_1.jpg"/>'],
//
//                    // 包含图片和字幕的格式
//                    [
//                        'content' => '<img src="http://c.hiphotos.baidu.com/image/pic/item/77c6a7efce1b9d16efbcc03afedeb48f8c546475.jpg"/>',
//                        'caption' => '<h4>This is title</h4><p>云山虎影</p>',
//                        //'options' => [...],       //配置对应的样式
//                    ],
//                    [
//                        'content' => '<img src="http://d.hiphotos.baidu.com/image/pic/item/32fa828ba61ea8d3f622db539a0a304e251f5860.jpg"/>',
//                        'caption' => '<h4>This is title</h4><p>This is the caption text</p>',
//                        //'options' => [...],       //配置对应的样式
//                    ],
//                ],
//                'options' => ['class' => 'carousel slide']
//            ]);
            ?>
        </div>
    </div>

</div>